<template>
  <component :is="nodeConfigName" :node="node" :key="node.id"></component>
</template>

<script>
import {
  computed,
  defineAsyncComponent,
  defineComponent,
  onMounted,
} from "vue";

const NodeConfigInput = defineAsyncComponent(() =>
  import("./node-config-input.vue")
);
const NodeConfigMerge = defineAsyncComponent(() =>
  import("./node-config-merge.vue")
);
const NodeConfigJoin = defineAsyncComponent(() =>
  import("./node-config-join.vue")
);
const NodeConfigFilter = defineAsyncComponent(() =>
  import("./node-config-filter.vue")
);
const NodeConfigDistinct = defineAsyncComponent(() =>
  import("./node-config-distinct.vue")
);
const NodeConfigIsNull = defineAsyncComponent(() =>
  import("./node-config-isnull.vue")
);
const NodeConfigSelect = defineAsyncComponent(() =>
  import("./node-config-select.vue")
);
const NodeConfigOrder = defineAsyncComponent(() =>
  import("./node-config-order.vue")
);
const NodeConfigUnion = defineAsyncComponent(() =>
  import("./node-config-union.vue")
);
const NodeConfigConst = defineAsyncComponent(() =>
  import("./node-config-const.vue")
);
const NodeConfigGroup = defineAsyncComponent(() =>
  import("./node-config-group.vue")
);
const NodeConfigChange = defineAsyncComponent(() =>
  import("./node-config-change.vue")
);
const NodeConfigRtc = defineAsyncComponent(() =>
  import("./node-config-rtc.vue")
);
const NodeConfigCtr = defineAsyncComponent(() =>
  import("./node-config-ctr.vue")
);
const NodeConfigAlias = defineAsyncComponent(() =>
  import("./node-config-alias.vue")
);
const NodeConfigFormat = defineAsyncComponent(() =>
  import("./node-config-format.vue")
);
const NodeConfigCompute = defineAsyncComponent(() =>
  import("./node-config-compute.vue")
);
const NodeConfigCongroup = defineAsyncComponent(() =>
  import("./node-config-congroup.vue")
);
export default defineComponent({
  name: "node-config-index",
  props: {
    node: Object,
  },
  components: {
    NodeConfigInput: NodeConfigInput,
    NodeConfigMerge: NodeConfigMerge,
    NodeConfigJoin: NodeConfigJoin,
    NodeConfigFilter: NodeConfigFilter,
    NodeConfigDistinct: NodeConfigDistinct,
    NodeConfigIsnull: NodeConfigIsNull,
    NodeConfigSelect: NodeConfigSelect,
    NodeConfigOrder: NodeConfigOrder,
    NodeConfigUnion: NodeConfigUnion,
    NodeConfigConst: NodeConfigConst,
    NodeConfigGroup: NodeConfigGroup,
    NodeConfigChange: NodeConfigChange,
    NodeConfigRtc: NodeConfigRtc,
    NodeConfigCtr: NodeConfigCtr,
    NodeConfigAlias: NodeConfigAlias,
    NodeConfigFormat: NodeConfigFormat,
    NodeConfigCompute: NodeConfigCompute,
    NodeConfigCongroup: NodeConfigCongroup,
  },
  setup(props, ctx) {
    const nodeConfigName = computed(() => {
      return `node-config-${props.node.type}`;
    });
    onMounted(() => {});
    return {
      nodeConfigName,
    };
  },
});
</script>

